3.14.20 \(\int (c (d \tan (e+f x))^p)^n (a+i a \tan (e+f x)) \, dx\) [1320]

Optimal. Leaf size=54 \[ \frac {a \, _2F_1(1,1+n p;2+n p;i \tan (e+f x)) \tan (e+f x) \left (c (d \tan (e+f x))^p\right )^n}{f (1+n p)} \]

[Out]

a*hypergeom([1, n*p+1],[n*p+2],I*tan(f*x+e))*tan(f*x+e)*(c*(d*tan(f*x+e))^p)^n/f/(n*p+1)

________________________________________________________________________________________

Rubi [A]
time = 0.05, antiderivative size = 54, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 28, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.107, Rules used = {12, 1970, 66} \begin {gather*} \frac {a \tan (e+f x) \, _2F_1(1,n p+1;n p+2;i \tan (e+f x)) \left (c (d \tan (e+f x))^p\right )^n}{f (n p+1)} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(c*(d*Tan[e + f*x])^p)^n*(a + I*a*Tan[e + f*x]),x]

[Out]

(a*Hypergeometric2F1[1, 1 + n*p, 2 + n*p, I*Tan[e + f*x]]*Tan[e + f*x]*(c*(d*Tan[e + f*x])^p)^n)/(f*(1 + n*p))

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 66

Int[((b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[c^n*((b*x)^(m + 1)/(b*(m + 1)))*Hypergeometr
ic2F1[-n, m + 1, m + 2, (-d)*(x/c)], x] /; FreeQ[{b, c, d, m, n}, x] &&  !IntegerQ[m] && (IntegerQ[n] || (GtQ[
c, 0] &&  !(EqQ[n, -2^(-1)] && EqQ[c^2 - d^2, 0] && GtQ[-d/(b*c), 0])))

Rule 1970

Int[(u_.)*((c_.)*((d_)*((a_.) + (b_.)*(x_)))^(q_))^(p_), x_Symbol] :> Dist[(c*(d*(a + b*x))^q)^p/(a + b*x)^(p*
q), Int[u*(a + b*x)^(p*q), x], x] /; FreeQ[{a, b, c, d, q, p}, x] &&  !IntegerQ[q] &&  !IntegerQ[p]

Rubi steps

\begin {align*} \int \left (c (d \tan (e+f x))^p\right )^n (a+i a \tan (e+f x)) \, dx &=\frac {i \text {Subst}\left (\int \frac {a \left (c (d x)^p\right )^n}{i+x} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {(i a) \text {Subst}\left (\int \frac {\left (c (d x)^p\right )^n}{i+x} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {\left (i a (d \tan (e+f x))^{-n p} \left (c (d \tan (e+f x))^p\right )^n\right ) \text {Subst}\left (\int \frac {(d x)^{n p}}{i+x} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {a \, _2F_1(1,1+n p;2+n p;i \tan (e+f x)) \tan (e+f x) \left (c (d \tan (e+f x))^p\right )^n}{f (1+n p)}\\ \end {align*}

________________________________________________________________________________________

Mathematica [B] Both result and optimal contain complex but leaf count is larger than twice the leaf count of optimal. \(173\) vs. \(2(54)=108\).
time = 0.91, size = 173, normalized size = 3.20 \begin {gather*} \frac {2^{-1-n p} a e^{-i e} \left (-\frac {i \left (-1+e^{2 i (e+f x)}\right )}{1+e^{2 i (e+f x)}}\right )^{1+n p} \left (1+e^{2 i (e+f x)}\right )^{1+n p} \cos (e+f x) \, _2F_1\left (1+n p,1+n p;2+n p;\frac {1}{2} \left (1-e^{2 i (e+f x)}\right )\right ) (\cos (f x)-i \sin (f x)) (1+i \tan (e+f x)) \tan ^{-n p}(e+f x) \left (c (d \tan (e+f x))^p\right )^n}{f+f n p} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(c*(d*Tan[e + f*x])^p)^n*(a + I*a*Tan[e + f*x]),x]

[Out]

(2^(-1 - n*p)*a*(((-I)*(-1 + E^((2*I)*(e + f*x))))/(1 + E^((2*I)*(e + f*x))))^(1 + n*p)*(1 + E^((2*I)*(e + f*x
)))^(1 + n*p)*Cos[e + f*x]*Hypergeometric2F1[1 + n*p, 1 + n*p, 2 + n*p, (1 - E^((2*I)*(e + f*x)))/2]*(Cos[f*x]
 - I*Sin[f*x])*(1 + I*Tan[e + f*x])*(c*(d*Tan[e + f*x])^p)^n)/(E^(I*e)*(f + f*n*p)*Tan[e + f*x]^(n*p))

________________________________________________________________________________________

Maple [F]
time = 0.12, size = 0, normalized size = 0.00 \[\int \left (c \left (d \tan \left (f x +e \right )\right )^{p}\right )^{n} \left (a +i a \tan \left (f x +e \right )\right )\, dx\]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((c*(d*tan(f*x+e))^p)^n*(a+I*a*tan(f*x+e)),x)

[Out]

int((c*(d*tan(f*x+e))^p)^n*(a+I*a*tan(f*x+e)),x)

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c*(d*tan(f*x+e))^p)^n*(a+I*a*tan(f*x+e)),x, algorithm="maxima")

[Out]

integrate((I*a*tan(f*x + e) + a)*((d*tan(f*x + e))^p*c)^n, x)

________________________________________________________________________________________

Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c*(d*tan(f*x+e))^p)^n*(a+I*a*tan(f*x+e)),x, algorithm="fricas")

[Out]

integral(2*a*e^(n*p*log((-I*d*e^(2*I*f*x + 2*I*e) + I*d)/(e^(2*I*f*x + 2*I*e) + 1)) + 2*I*f*x + n*log(c) + 2*I
*e)/(e^(2*I*f*x + 2*I*e) + 1), x)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} i a \left (\int \left (- i \left (c \left (d \tan {\left (e + f x \right )}\right )^{p}\right )^{n}\right )\, dx + \int \left (c \left (d \tan {\left (e + f x \right )}\right )^{p}\right )^{n} \tan {\left (e + f x \right )}\, dx\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c*(d*tan(f*x+e))**p)**n*(a+I*a*tan(f*x+e)),x)

[Out]

I*a*(Integral(-I*(c*(d*tan(e + f*x))**p)**n, x) + Integral((c*(d*tan(e + f*x))**p)**n*tan(e + f*x), x))

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c*(d*tan(f*x+e))^p)^n*(a+I*a*tan(f*x+e)),x, algorithm="giac")

[Out]

integrate((I*a*tan(f*x + e) + a)*((d*tan(f*x + e))^p*c)^n, x)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.02 \begin {gather*} \int {\left (c\,{\left (d\,\mathrm {tan}\left (e+f\,x\right )\right )}^p\right )}^n\,\left (a+a\,\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right ) \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((c*(d*tan(e + f*x))^p)^n*(a + a*tan(e + f*x)*1i),x)

[Out]

int((c*(d*tan(e + f*x))^p)^n*(a + a*tan(e + f*x)*1i), x)

________________________________________________________________________________________